<div class="toolbar">
  <div class="toolbar-header">
    <%= "ID: #{@patient.id} - #{@patient.full_name}" %>
  </div>
</div>

<ul class="nav nav-tabs">
  <li class="active"><a href="#patient_detail" data-toggle="tab"><%= t :general_info %></a></li>
  <li><a href="#medical_record" data-toggle="tab"><%= t :medical_record %></a></li>
  <li><a href="#appointment_history" data-toggle="tab"><%= t :appointment_history %></a></li>
</ul>

<!-- Tab panes -->
<div class="tab-content">
  <div class="tab-pane active" id="patient_detail">
    <div class="row toolbar">
	  <div class="col-md-6">
		<span class="toolbar-header">
		  <%= t :general_info %>
		</span>
	  </div>
	  <div class="col-md-6 text-right">
		<ul class="toolbar-nav">
		  <li><% link_to feather_icon('circle-plus'), new_appointment_path %></li>
		  <li><%= link_to simple_icon('note'), edit_patient_path(@patient) %></li> 
          <li><%= link_to feather_icon('trash'), @patient, method: :delete, data: { confirm: 'Are you sure?' } %></li>
		</ul>
	  </div>
	</div>
	<table class="table table-striped">
      <tbody>
        <tr>
          <td style="width: 200px"><strong><%= t :name %></strong></td>
          <td><%= @patient.full_name %></td>
        </tr>
        <tr>
          <td><strong><%= t :dob %></strong></td>
          <td><%= @patient.dob %></td>
        </tr>
        <tr>
          <td><strong><%= t :blood_type %></strong></td>
          <td><%= "A+" %></td>
        </tr>
        <tr>
          <td><strong><%= t :weight %></strong></td>
          <td><%= "165 cm" %></td>
        </tr>
        <tr>
          <td><strong><%= t :height %></strong></td>
          <td><%= "70 kg" %></td>
        </tr>
        <tr>
          <td><strong><%= t :mobile %></strong></td>
          <td><%= @patient.mobile %></td>
        </tr>
        <tr>
          <td><strong>Email</strong></td>
          <td><%= @patient.email %></td>
        </tr>
      </tbody>
  </table>
  <div class="row toolbar">
	  <div class="col-md-6">
		<span class="toolbar-header">
		  Address
		</span>
	  </div>
	  <div class="col-md-6 text-right">
		<ul class="toolbar-nav">
		  <li><%= link_to feather_icon('circle-plus'), new_patient_contact_path(:patient_id => params[:id]) %></li>
		</ul>
	  </div>
  </div>
  <%= render @patient.contacts %>			
  </div>
  <div class="tab-pane" id="medical_record">
  	<div class="row toolbar">
	  <div class="col-md-6">
		<span class="toolbar-header">
		  <%= t :medical_record %>
		</span>
	  </div>
	  <div class="col-md-6 text-right">
		<ul class="toolbar-nav">
		  <li><% link_to feather_icon('circle-plus'), new_appointment_path %></li>
		</ul>
	  </div>
	</div>
  </div>
  <div class="tab-pane" id="appointment_history">
    <div class="row toolbar">
	  <div class="col-md-6">
		<span class="toolbar-header">
		  <%= t :appointment_history %>
		</span>
	  </div>
	  <div class="col-md-6 text-right">
		<ul class="toolbar-nav">
		  <li><%= link_to feather_icon('circle-plus'), new_appointment_path %></li>
		</ul>
	  </div>
	</div>
	<table class="table table-striped">
      <thead>
      <tr>
        <th><%= t :date_translate %></th>
        <th><%= t :time_translate %></th>
        <th><%= t :staff_in_charge %></th>
        <th><%= t :appointment_status %></th>
        <th><%= t :registration_method %></th>
        <th></th>
      </tr>
      </thead>
      <tbody>
      <% @appointments.each do |appointment| %>
        <tr>
          <td><%= appointment.date_appointment %></td>
          <td><%= appointment.time_appointment.to_s(:time) %></td>
          <td><%= appointment.staff.full_name %></td>
          <td><%= appointment.appointment_status.label %></td>
          <td><%= appointment.registration_method.label %></td>
          <td><%= link_to simple_icon('user'), appointment %> 
        <%= link_to simple_icon('note'), edit_appointment_path(appointment) %> 
        <%= link_to feather_icon('trash'), appointment, method: :delete, data: { confirm: 'Are you sure?' } %></td>
        </tr>
      <% end %>
      </tbody>
    </table>
  </div>
</div>

